# Maintainer: Frederic Wang <fred.wang@free.fr>

_realname=enum34
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=1.0.4
pkgrel=1
pkgdesc='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4 (mingw-w64)'
arch=('any')
url='https://pypi.python.org/pypi/enum34'
license=('BSD')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2")
source=("https://pypi.python.org/packages/source/e/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('d3c19f26a6a34629c18c775f59dfc5dd595764c722b57a2da56ebfb69b94e447')

prepare() {
  cd "${srcdir}"
  cp -r ${_realname}-${pkgver} python2-build
}

package_python2-enum34() {
  depends=("${MINGW_PACKAGE_PREFIX}-python2")

  cd ${srcdir}/python2-build
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
    --root="${pkgdir}" --optimize=1

  install -Dm644 enum/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
}

package_mingw-w64-i686-python2-enum34() {
  package_python2-enum34
}

package_mingw-w64-x86_64-python2-enum34() {
  package_python2-enum34
}
